Env Sensor
Sensor for measuring external environmental humidity and temperature.
import { Humidity,Temperature } from "@devicescript/core"
const humidity = new Humidity()
const temperature = new Temperature()
Registers
reading
The temperature.
- read only
import { Humidity,Temperature } from "@devicescript/core"
const temperature = new Temperature()
const humidity = new Humidity()
const temp = await temperature.reading.read()
const hum = await humidity.reading.read()
- track incoming values
import { Humidity,Temperature } from "@devicescript/core"
const temperature = new Temperature()
const humidity = new Humidity()
temperature.reading.subscribe(async (value) => {
...
})
humidity.reading.subscribe(async (value) => {
...
})
minReading
Lowest temperature that can be reported.
- read only
import { Humidity,Temperature } from "@devicescript/core"
const temperature = new Temperature()
const humidity = new Humidity()
const temp = await temperature.minReading.read()
const hum = await humidity.minReading.read()
maxReading
Highest temperature that can be reported.
- read only
import { Humidity,Temperature } from "@devicescript/core"
const temperature = new Temperature()
const humidity = new Humidity()
const temp = await temperature.maxReading.read()
const hum = await humidity.maxReading.read()
readingError
The real temperature is between temperature - temperature_error
and temperature + temperature_error
.
- read only
import { Humidity,Temperature } from "@devicescript/core"
const temperature = new Temperature()
const humidity = new Humidity()
const temp = await temperature.readingError.read()
const hum = await humidity.readingError.read()
- track incoming values
import { Humidity,Temperature } from "@devicescript/core"
const temperature = new Temperature()
const humidity = new Humidity()
temperature.readingError.subscribe(async (value) => {
...
})
humidity.readingError.subscribe(async (value) => {
...
})
variant
Specifies the type of thermometer.
- read only
import { Humidity,Temperature } from "@devicescript/core"
const temperature = new Temperature()
const humidity = new Humidity()
const temp = await temperature.variant.read()
const hum = await humidity.variant.read()